<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
session_start();
include_once("../../config.inc.php");
include_once(__Modules_Path."/LogRecord.lib.php");
include_once(__Modules_Path."/Gamble.lib.php");
include_once(__Common_Path."/Lotto.inc.php");

$_SESSION["Admin_Info"] -> Account = trim($_data["UserAcc"]);
$_SESSION["Admin_Info"] -> ID = 99999999;
$intLID = (int)$_data["LottoID"];
$intGID = (int)$_data["GID"];
$intWID = (int)$_data["Web"];
$strBT = trim($_data["Bet_Type"]);
$arrLotto = $_arrLotto[$intLID];
$intLType = (int)$arrLotto["LType"];

$isStopBet = (int)$_data["isStopBet"];
if($isStopBet != 0)$isStopBet = 1;

$_isDBExist = "no";
$strCon = "";
include(__DBConnect_File);
if($_strLogErr != ""){
	$strCon .= "DB Error => ".$_strLogErr."\n\n";

}else{

	PMA_mysql_query("BEGIN", $_ConnMaster);
	if(!StopAllBetTodayGame($intGID, $intLID, $strBT, $intLType, $isStopBet, "")){
		PMA_mysql_query("ROLLBACK", $_ConnMaster);
		$strCon .= "Stop Error!!\nErrMsg: ".$GLOBALS["errormessage"]."\nErrHiden: ".$GLOBALS["errorhidden"]."\n\n";
		$GLOBALS["errorhidden"];
	}else{
		PMA_mysql_query("COMMIT", $_ConnMaster);
		$strCon .= ($isStopBet != 0)?"Stop OK!!\n\n":"Open OK!!\n\n";
	}
}

$strLog = "UserAcc => ".$_SESSION["Admin_Info"] -> Account."\n";
$strLog .= "Param => ".print_r($_data, true)."\n";
$strLog .= "Cont => ".$strCon."\n";
AddData_Log($_SESSION["Admin_Info"] -> ID, "統一停押", $strLog);

WebOutputHTML($strCon, 1);
?>